package mylibrary.collection;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;

public class SetTest {

	public static void main(String[] args) {
		
		Set set = new HashSet();
		
		Item item1 = new Item("gao", "10");
		Item item2 = new Item("shuai", "20");
		
//		System.out.println(set.add(item1));
//		System.out.println(set.add(item2));
		
//		System.out.println(item1.hashCode());
//		System.out.println(item2.hashCode());
//		System.out.println(set.size());
		
		Set test = new TreeSet();
		test.add(item1);
		test.add(item2);
		
		Set treeSet1 = new TreeSet();
		treeSet1.add("nihao");
		treeSet1.add("gaoshuai");
		treeSet1.add("dage");
		
		Iterator it = treeSet1.iterator();
		while(it.hasNext()) {
			System.out.println(it.next());
		}
	}
	
}
